from rest_framework.permissions import BasePermission


class AssignRolePermission(BasePermission):

    def has_permission(self, request, view):
        user = request.user
        return user.has_permission_code('role:permissions')

    def has_object_permission(self, request, view, obj):
        return True
